import request from '../../api/base'

export function getMemberLeaveList(date) {
  let data = { pageSize: 100, pageNum: 1, date };
  return request({
    method: 'post',
    url: 'api/member/api-member/memberLeave/getMemberLeaveList',
    data: data,
  }).then(res => {
    if (res.flag) {
      return res.data
    }
    return [];
  })
}

export function deleteLeave(id) {
  return request({
    method: 'delete',
    url: 'api/member/api-member/memberLeave/deleteLeave',
    data: {id},
    requestType: 'form'
  }).then(res => res)
}

export function getResidueDay() {
  return request({
    method: 'post',
    url: 'api/member/api-member/memberLeave/getResidueDay',
  }).then(res => {
    if (res.flag) {
      return res.data
    }
  })
}

export function getRealLeaveDay(data) {
  return request({
    method: 'post',
    url: 'api/member/api-member/memberLeave/getRealLeaveDay',
    data: {...data},
  }).then(res => {
    if (res.flag) {
      return res.data
    }
  })
}

export function saveOrUpdateLeave(data) {
  return request({
    method: 'post',
    url: 'api/member/api-member/memberLeave/saveOrUpdateLeave',
    data: data,
  }).then(res => res)
}

export function leaveBpm(data) {
  return request({
    method: 'post',
    url: 'api/member/api-member/bpm/leaveBpm',
    data: data,
    requestType: 'form'
  }).then(res => res)

}


